package my.design.principle;

/**
 * @author zp
 * @version 1.0
 * @description: 行为原则第一条 单一原则
 * 符合单一原则 但是开销大 每一个类型都实现一个类
 * 修改起来麻烦
 * @date 2022/9/26 18:51
 */
public class SingleResponsibility2 {
    public static void main(String[] args) {
        RoadVehicle vehicle = new RoadVehicle();
        vehicle.run("汽车");
    }
}

class RoadVehicle{
    public void run(String vehicle){
        System.out.println(vehicle+"在马路上运行");
    }
}

class AirVehicle{
    public void run(String vehicle){
        System.out.println(vehicle+"在天上运行");
    }
}
